program Inside;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, i, k, s, r, x0, y0, outside :integer;
  x, y :array of integer;

begin
  writeln('Enter n');
  readln(n);
  writeln('Enter x0 y0');
  readln(x0);
  readln(y0);
  setlength(x, n+1);
  setlength(y, n+1);
  for i:=1 to n do
    begin
      writeln('Enter x', i, ' y', i);
      readln(x[i]);
      readln(y[i]);
    end;

  s:=0;
  for i:=2 to n-1 do
    begin
      s:=s+abs((x[1]*y[i]-x[i]*y[1])+(x[i]*y[i+1]-x[i+1]*y[i])+(x[i+1]*y[1]-x[1]*y[i+1]));
    end;

  outside:=0;
  r:=0;
  for i:=1 to n do
    begin
      k:=i+1;
      if (k>n) then k:=1;

      r:=r+abs((x0*y[i]-x[i]*y0)+(x[i]*y[k]-x[k]*y[i])+(x[k]*y0-x0*y[k]));
      if (r>s) then
      begin
        outside:=1;
        break;
      end;
    end;

  writeln;
  writeln(s);
  writeln(r);
  if (outside>0) then
    writeln('It is outside')
    else
    writeln('It is inside');
  readln;
end.
